package microframe.manager
{
	import com.ux.manager.StageManager;
	import com.ux.manager.getApplicationURL;
	
	import flash.utils.Dictionary;

	/**
	 * @author winnie
	 */	
	public class URLManager
	{
		private static var dicUrl : Dictionary;
		private static var rootPath: String;
		
		/**
		 * @param contentsType ContentsTypeManager 에 등록된 타입으로 url 반환
		 * @return url
		 */		
		public static function url( contentsType:String ):String
		{
			if( dicUrl == null )
			{
				dicUrl = new Dictionary();
				
				
				//-----------------------------------------------------------------------------------
				//
				// 아래에 url 을 등록하세요.
				//
				//-----------------------------------------------------------------------------------
				
				dicUrl[ ContentsTypeManager.MAIN ] = "main.swf";
				
				dicUrl[ ContentsTypeManager.HIGHTOP_0 ] = "HIGHTOP_0.swf";
				dicUrl[ ContentsTypeManager.HIGHTOP_1 ] = "HIGHTOP_1.swf";
				dicUrl[ ContentsTypeManager.HIGHTOP_2 ] = "HIGHTOP_2.swf";
				
				dicUrl[ ContentsTypeManager.FUNFUN_0 ] = "FUNFUN_0.swf";
				dicUrl[ ContentsTypeManager.FUNFUN_1 ] = "FUNFUN_1.swf";
				dicUrl[ ContentsTypeManager.FUNFUN_2 ] = "FUNFUN_2.swf";
				
				dicUrl[ ContentsTypeManager.BOARD_0 ] = "BOARD_0.swf";
				dicUrl[ ContentsTypeManager.BOARD_1 ] = "BOARD_1.swf";
				dicUrl[ ContentsTypeManager.BOARD_2 ] = "BOARD_2.swf";
				
				dicUrl[ ContentsTypeManager.EVENT_0_0 ] = "EVENT_0_0.swf";
				dicUrl[ ContentsTypeManager.EVENT_0_1 ] = "EVENT_0_1.swf";
				dicUrl[ ContentsTypeManager.EVENT_1 ] 	= "EVENT_1.swf";
				
				// 배경음악 url 을 등록하면 사운드 컨트롤이 가능하다. 사용하지 않을 시 "" 로 하면 됨.
				dicUrl[ "sound" ] = "";
			}
			
			if( rootPath == null )
			{
				rootPath = getApplicationURL( StageManager.stage.loaderInfo );
			}
			
			if( dicUrl[ contentsType ] == "" || dicUrl[ contentsType ] == null ) 
			{
				return "";
			}
			else
			{
				return rootPath + dicUrl[ contentsType ];
			}
		}
		
		/**
		 * URLManager
		 */		
		public function URLManager()
		{
		}
	}
}